package MyDS.Test;

import MyDS.BinarySearchTree.BinarySearchTree;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 * @Author: ylc
 * @Description:
 * @Date Created in 2022-04-18 17:14
 */
public class BinarySearchTreeTest {
    int[] data = {41,58,50,60,60,42,53,59,63,63};
    BinarySearchTree bst = new BinarySearchTree();

    @Before
    public void testInsertIntoBST(){
        for (int i : data) {
            bst.insertIntoBST(i);
        }
    }

    @Test
    public void testContains(){
        boolean result = bst.contains(41);
        //Assert.assertEquals(true,result);
        Assert.assertTrue(result);

    }
    @Test
    public void testDeleteNode(){
        bst.deleteNode(58);
        bst.preOrder();
    }
    @Test
    public void testPreOrder(){
        bst.preOrder();
    }
}
